package raft

type Role uint8

const (
	Follower  Role = iota // 跟随者
	Candidate             // 候选人
	Leader                // 领导者
	Fail                  // 节点进入失败状态
)

func (r Role) String() string {
	switch r {
	case Follower:
		return "Follower"
	case Candidate:
		return "Candidate"
	case Leader:
		return "Leader"
	case Fail:
		return "Fail"
	default:
		return "Unknown"
	}
}
